<!DOCTYPE html>
<html lang="zh">
<head>
    <style>
        * {
            padding: 0;
            margin: 0;
            box-sizing: border-box; }

        body {
            height: 100vh; }

        body {
            background-image: linear-gradient(90deg, #EBD7DF 25%, #C8DEEF);
            position: relative; }

        .box {
            width: 1050px;
            height: 600px;
            position: absolute;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
            display: flex;
            justify-content: center;
            border: 1px solid #fff;
            box-shadow: 2px 3px 5px #FCF6FD;
        }
        .box .register-form {
            width: 50%; }
        .box .login-box {
            width: 50%; }

        .pre-box {
            position: absolute;
            top: 0;
            left: 0;
            width: 50%;
            height: 100%;
            background-color: #EBD7DF;
            border-radius: 4px;
            box-shadow: 4px 4px 3px rgba(0, 0, 0, 0.1);
            transition: 0.5s ease-in-out; }

        .pre-box h1 {
            margin-top: 150px;
            color: #fff;
            text-align: center;
            letter-spacing: 5px;
            text-shadow: 4px 4px 3px rgba(0, 0, 0, 0.1);
            margin-bottom: 50px; }

        .img-box {
            width: 250px;
            height: 250px;
            border-radius: 50%;
            overflow: hidden;
            margin: 0 auto; }

        .img-box img {
            width: 100%;
            transition: 0.5s; }

        .title-box h1 {
            margin-top: 200px;
            text-align: center;
            text-shadow: 4px 4px 3px rgba(0, 0, 0, 0.1); }

        .input-box input {
            border-color: #C8DEEF;
            height: 40px;
            width: 270px;
            border-radius: 5px;
            margin: 15px 0;
            margin-left: 25%;
            padding-left: 5px;
            font-size: 1rem; }

        .input-box input:hover {
            cursor: pointer;
            opacity: .8; }

        .btn-box p {
            display: inline-block;
            color: #FCF6FD;
            font-size: 1.1rem; }

        .btn-box p:hover {
            cursor: pointer;
            border-bottom: 1px solid #fff; }

        .btn-box button {
            display: inline-block;
            border: none;
            width: 90px;
            height: 40px;
            background-color: #63AEF1;
            color: #fff;
            border-radius: 3px;
            margin-left: 30%;
            margin-top: 10px;
            font-size: 20px; }
    </style>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="https://code.jquery.com/jquery-3.6.1.js" integrity="sha256-3zlB5s2uwoUzrXK3BT7AX3FyvojsraNFxCc2vC/7pNI=" crossorigin="anonymous"></script>
    <title>登录</title>

</head>
<body>
<form action="../user/loginAuth" method="POST">
<div class="box ">
    <div class="pre-box">
        <h1>Hello</h1>
        <div class="img-box">
            <img src="https://img0.baidu.com/it/u=1511000726,4095290485&fm=253&app=138&size=w931&n=0&f=JPEG&fmt=auto?sec=1686416400&t=47eb9830532a691b0e5f5e543f0f1d41" alt="">
        </div>
    </div>
        <div class="register-form">
            <div class="title-box">
                <h1>注册</h1>
            </div>
            <div class="input-box">
                <input type="text" name="text" placeholder="用户名">
                <input type="password" name="pwd" placeholder="密码">
                <input type="password" name="pwdTo" placeholder="确认密码">
            </div>
            <div class="btn-box">
                <button>注册</button>
                <p onclick="mySwitch()">已有账户？去登录</p>
            </div>
        </div>
        <div class="login-box">
            <div class="title-box">
                <h1>登录</h1>
            </div>
            <div class="input-box">
                <input type="text" name="loginText" placeholder="用户名">
                <input type="password" name="loginPwd" placeholder="密码">

            </div>
            <div class="btn-box">
                <button type="submit">登录</button>
                <p onclick="mySwitch()">没有账户？去注册</p>
            </div>
        </div>
    <script>
        let fl=true
        const mySwitch=()=>{
            if(fl){
                $(".pre-box").css("transform","translateX(100%)")
                $(".pre-box").css("background-color","#C8DEEF")
                $(".img").attr("scr","./img/img1.ipg")
            }else{
                $(".pre-box").css("transform","translateX(0%)")
                $(".pre-box").css("background-color","#EBD7DF")
                $(".img").attr("scr","./img/img2.jpg")
            }
            fl=!fl
        }

    </script>
</div>
</form>
</body>
</html>





